<!--
 * @Author: your name
 * @Date: 2021-05-24 16:06:35
 * @LastEditTime: 2021-05-29 15:40:22
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \遵义报名\zunyi\src\views\login\login.vue
-->
<template>
  <el-dialog :visible.sync="dialogVisible" width="30%" 
  :show-close="false"
  :close-on-click-modal="false"
  :close-on-press-escape="false"
  >
    <p class="p1">遵义职业技术学院</p>
    <p>考证在线报名收费系统</p>
    <el-divider class="divider">登录方式</el-divider>
    <!-- <el-image class="img"
      style="width: 35px; height: 35px"
      :src="require('@/assets/weixin.png')"
    ></el-image> -->
    <span class="iconfont" @click="toWeChatLogin">&#xe6a9;</span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: true,
      appid: "wx7496665e5f925df9",
      redirect_uri: "http://t1.ossjk.com/zyjsxy-miniapp-api/pcWxlogin",
    };
  },
  methods: {
    toWeChatLogin() {
      let appid = this.appid;
      let redirect_uri = encodeURIComponent(this.redirect_uri);

      window.location.href = `https://open.weixin.qq.com/connect/qrconnect?appid=${appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect`;
    },
  },
};
</script>

<style lang="scss" scoped>
p {
  font-size: 25px;
  text-align: center;
  width: 100%;
  cursor: pointer;
}
.p1 {
  margin-bottom: 10px;
}
.divider {
  border: 1px solid #dcdfe6;
  border-radius: 10px;
}
.iconfont {
  display: flex;
  justify-content: center;
  font-size: 30px;
  color: #04be02;
  cursor: pointer;
}
</style>